/**
 * 0160
 *  
 * @Author : roryrywang
 * @DateTime : 2024/8/13 21:29
 */

#include <iostream>
#include <vector>

using namespace std;

struct ListNode {
    int val;
    ListNode *next;

    ListNode(int x) : val(x), next(NULL) {}
};

class Solution {
public:
    ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
        ListNode *ha = headA;
        ListNode *hb = headB;
        while (ha != hb) {
            ha = ha == nullptr ? headB : ha->next;
            hb = hb == nullptr ? headA : hb->next;
        }
        return ha;
    }
};

int main() {

    return 0;
}